﻿using WB.Mvc.Forms.Widgets;

namespace WB.Mvc.Forms
{
	/// <summary>
	/// Represents a field that takes string input.
	/// </summary>
	public class CharField : Field
	{
		/// <summary>
		/// Creates an instance of <see cref="CharField"/>.
		/// </summary>
		public CharField(string name) : base(name)
		{
		}

		/// <summary>
		/// Gets the widget used to render the input for this field.
		/// </summary>
		public override Widget GetWidget()
		{
			return new TextInput(Name) {Value = Value};
		}
	}
}